package com.bwton.msx.ccb.utils;

import android.view.View;

import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;

public class RxViewUtils {
    public static Observable<View> throttle(View view,int timeout){
        return Observable.create((ObservableOnSubscribe<View>) emitter -> view.setOnClickListener(emitter::onNext))
                .throttleFirst(timeout, TimeUnit.SECONDS);
    }
}
